package com.itheima.mm.controller;

import com.itheima.mm.entity.Result;
import com.itheima.mm.service.DictService;
import com.itheima.mm.vo.DictVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description DictController
 * @Author xiao
 * @Date 2024-06-26
 */
@RestController
@Slf4j
@RequestMapping("/dict")
public class DictController {

    @Autowired
    private DictService dictService;

    @GetMapping("/findListByType.do")
    public Result<List<DictVO>> findListByType(Integer typeId){
        log.info("开始执行获取数据字典数据接口：{}",typeId);

        List<DictVO> dictVOList = dictService.selectListByType(typeId);

        return Result.success(dictVOList);

    }
}
